/*
 * Copyright 2011 The Rusted Roof, LLC.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package org.proteusframework.platformservice.theme;

import org.proteusframework.core.api.model.INamespace;
import org.proteusframework.platformservice.IServicePlugin;
import org.proteusframework.platformservice.theme.menu.IMenuBlock;
import org.proteusframework.platformservice.theme.menu.IMenuBlockItem;
import org.proteusframework.platformservice.theme.panel.IContentBlock;
import org.proteusframework.platformservice.theme.panel.IDialog;
import org.proteusframework.platformservice.theme.panel.IPanelBlock;
import org.proteusframework.platformservice.theme.panel.IProgressDialog;
import org.proteusframework.platformservice.theme.toolbar.IToolbar;
import org.proteusframework.platformservice.theme.toolbar.IToolbarItem;

/**
 * Platform agnostic theme platform service.
 */
public interface IThemeService extends IServicePlugin
{
    public static int YES_NO_OPTION = 0;

    public static int YES_NO_CANCEL_OPTION = 1;

    public static int QUESTION_MESSAGE = 3;

    public static int YES_OPTION = 0;

    public static int NO_OPTION = 1;

    public static int CANCEL_OPTION = 2;

    /**
     * Instantiates the primary frame window that visualizes the concrete theme.
     */
    void createFrame();

    /**
     * Access the primary frame window.
     *
     * @return Frame window, if it can be successfully cast to the expected frame type
     * @throws IllegalArgumentException when the frame cannot be cast to the expected frame type
     */
    <T> T getFrame(Class<?> expectedFrameType) throws IllegalArgumentException;

    void createContentBlock(IContentBlock contentBlock);

    void showDialog(IDialog dialog);

    void createMenuBlock(IMenuBlock menuBlock);

    void createMenuBlock(IMenuBlock menuBlock, IMenuBlockItem... menuBlockItem);

    void createPanelBlock(IPanelBlock panelBlock);

    void createToolbar(IToolbar toolBar);

    void createToolbar(IToolbar toolBar, IToolbarItem... toolBarItem);

    void showErrorMessage(String message);

    void createProgressDialog(IProgressDialog dialog, int minimumValue, int maximumValue);

    void incrementProgress(INamespace progressNamespace);

    void setProgressMessage(INamespace progressNamespace, String message);

    int showConfirmDialog(String message, int optionType, int messageType);

    void showStatusMessage(String message);
}
